﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelectEmps.aspx.cs" Inherits="RN.ERP.Web.Exam.SelectEmps" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>
        <%=PageTitle %></title>
    <link href="../Styles/style.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/style_msg.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../Scripts/iepngfix_tilebg.js"></script>
    <script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="../My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <link rel="Stylesheet" type="text/css" href="../Scripts/ligerUI/skins/Aqua/css/ligerui-all.css" />
    <script type="text/javascript" src="../Scripts/ligerUI/js/ligerui.min.js"></script>
    <script type="text/javascript">
        function OpenAlert(text) {
            $.ligerDialog.warn(text);
            return false;
        }
        $(function () {

            $(".return_a").click(function () {
                parent.window.CloseWin("0");
                window.parent.$.ligerDialog.close(); ////关闭dialog
                parent.$(".l-dialog,.l-window-mask").hide(); ////去除父窗体遮罩层
            });
            $(".cb_check").click(function () {
                if ($("#hidType").val() == "3") {
                    if ($(this).attr('checked')) {
                        $('input[type="checkbox"]').removeAttr('checked');
                        $(this).attr('checked', 'checked');
                    }
                }
                else {
                    var strs = new Array();
                    if ($("#hidEmps").val() != "") {
                        strs = $("#hidEmps").val().split(",");
                    }
                    var emps = new Array();
                    if ($("#hidNote").val() != "") {
                        emps = $("#hidNote").val().split("@");
                    }
                    var names = new Array();
                    if ($("#hidNames").val() != "") {
                        names = $("#hidNames").val().split(",");
                    }
                    var guid = $(this).val();
                    var name = $(this).attr("empname");
                    var datas = "{\"EmpGuid\":\"" + guid + "\",\"Name\":\"" + $(this).attr("empname") + "\",\"IDCard\":\"" + $(this).attr("idcard") + "\"}";
                    if ($(this).attr("checked") && $.inArray(guid, strs) >= 0) {
                        return;
                    }
                    else if ($(this).attr("checked") && $.inArray(guid, strs) < 0) {
                        strs.push(guid);
                        emps.push(datas);
                        names.push(name);
                    }
                    else if (!$(this).attr("checked") && $.inArray(guid, strs) >= 0) {
                        strs.splice($.inArray(guid, strs), 1);
                        emps.splice($.inArray(datas, emps), 1);
                        names.splice($.inArray(name, names), 1);
                    }
                    $("#hidEmps").val(strs.join());
                    $("#hidNote").val(emps.join("@"));
                    $("#hidNames").val(names.join());
                    //alert($("#hidNote").val());
                }
            });
        })
        function CloseWin() {
            top.ChildDialogCallBack = "CloseWin";
            top.ChildDialogClose(1);
        }
        function CloseWin1() {
            parent.window.CloseWin("1");
            window.parent.$.ligerDialog.close(); ////关闭dialog
            parent.$(".l-dialog,.l-window-mask").hide(); ////去除父窗体遮罩层
        }
        function ConfirmEmp() {
            var names = new Array();
            if ($("#hidNames").val() != "") {
                names = $("#hidNames").val().split(",");
                var tishi = "*请确认报名人员信息：<br/>";
                for (i = 0; i < names.length; i++) {
                    tishi += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + names[i] + " <br/>";
                }
                $.ligerDialog.confirm(tishi, '提示', function (yes) {
                    if (yes) __doPostBack('lbBM', '');
                });
            }
            else {
                OpenAlert("请选择人员！");
                return false;
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
            <tr>
                <td width="16" class="title_lbg IE6png">
                </td>
                <td width="24" class="title_t IE6png">
                </td>
                <td width="750" class="title_libg IE6png">
                    报名列表
                </td>
                <td width="17" class="title_rbg IE6png">
                </td>
            </tr>
            <tr id="tbCorp" runat="server">
                <td class="border_lbg IE6png">
                    &nbsp;
                </td>
                <td colspan="2" style="padding-top: 16px; padding-left: 6px; padding-right: 6px;">
                    <div>
                        <div class="xian">
                            <div class="about_title">
                                报名列表</div>
                            <div style="text-align: right;">
                                <asp:DropDownList ID="ddlQC" runat="server" Enabled="false">
                                </asp:DropDownList>
                            </div>
                        </div>
                        <table style="width: 100%; padding-bottom: 10px; background-color: #eaeaea;">
                            <tr style="height: 50px;">
                                <td style="padding-left: 10px;">
                                    姓名：
                                </td>
                                <td style="text-align: left;">
                                    <asp:TextBox ID="txtName" runat="server" CssClass="text_css"></asp:TextBox>
                                </td>
                                <td style="padding-left: 10px;">
                                    身份证号：
                                </td>
                                <td style="text-align: left;">
                                    <asp:TextBox ID="txtIDCard" runat="server" CssClass="text_css"></asp:TextBox>
                                </td>
                                <td style="text-align: left;">
                                    <span class="xtbiao">
                                        <asp:LinkButton ID="lbSearch" runat="server" Text="查询" OnClick="lbSearch_Click"></asp:LinkButton></span>
                                </td>
                                <td style="text-align: left;" id="tbBm" runat="server">
                                    <span class="xtbiao">
                                        <asp:LinkButton ID="lbBM" runat="server" Text="报名" OnClick="lbBM_Click" OnClientClick="ConfirmEmp();return false;"></asp:LinkButton></span>
                                </td>
                            </tr>
                        </table>
                        <br />
                        <telerik:RadGrid ID="RadGrid1" runat="server" ShowStatusBar="True" AllowSorting="true"
                            CssClass="tab" AllowFilteringByColumn="false" CellSpacing="0" Culture="zh-CN"
                            GridLines="None" AllowPaging="true" AllowCustomPaging="true" OnNeedDataSource="RadGrid1_NeedDataSource"
                            Width="100%" OnItemDataBound="RadGrid1_ItemDataBound">
                            <MasterTableView AutoGenerateColumns="false" DataKeyNames="EmpGuid" NoMasterRecordsText="暂无数据"
                                InsertItemPageIndexAction="ShowItemOnCurrentPage" CommandItemDisplay="Top">
                                <CommandItemSettings ExportToPdfText="Export to PDF" />
                                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="true">
                                </RowIndicatorColumn>
                                <EditFormSettings>
                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                    </EditColumn>
                                </EditFormSettings>
                                <PagerStyle AlwaysVisible="True" />
                                <CommandItemTemplate>
                                </CommandItemTemplate>
                                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
                                </ExpandCollapseColumn>
                                <Columns>
                                    <telerik:GridTemplateColumn HeaderText="选择" UniqueName="Choose" HeaderStyle-Width="7%"
                                        HeaderStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <input id="ckbChoose" type="checkbox" value='<%#Eval("EmpGuid") %>' empname='<%#Eval("Name") %>'
                                                idcard='<%#Eval("IDCard") %>' class="cb_check" runat="server" />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridBoundColumn DataField="Name" HeaderText="姓名" UniqueName="Name" HeaderStyle-Width="30%"
                                        HeaderStyle-HorizontalAlign="Center">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="IDCard" HeaderText="身份证号" UniqueName="IDCard"
                                        HeaderStyle-Width="50%" HeaderStyle-HorizontalAlign="Center">
                                    </telerik:GridBoundColumn>
                                </Columns>
                            </MasterTableView>
                            <ClientSettings EnableRowHoverStyle="true">
                                <Selecting AllowRowSelect="True"></Selecting>
                            </ClientSettings>
                            <PagerStyle AlwaysVisible="True" />
                            <FilterMenu EnableImageSprites="False">
                            </FilterMenu>
                        </telerik:RadGrid>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tab" style="margin-bottom: 15px;
                            margin-top: 15px;" id="tbChange" runat="server" visible="false">
                            <tr>
                                <td width="15%" bgcolor="#f2f2f2">
                                    <strong>更换原因</strong>
                                </td>
                                <td colspan="3" style="text-align: left;">
                                    <asp:TextBox ID="txtReason" runat="server" Height="100px" TextMode="MultiLine" Width="95%"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtReason"
                                        ErrorMessage="*" Display="Dynamic" ValidationGroup="aa" ForeColor="Red"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align: center;" width="50%" colspan="2">
                                    <div class="icon01 IE6png">
                                        <asp:LinkButton ID="lbChange" runat="server" Text="更换" OnClick="lbChange_Click" ValidationGroup="aa"></asp:LinkButton>
                                    </div>
                                </td>
                                <td style="text-align: center;" width="50%" colspan="2">
                                    <div class="icon02 IE6png">
                                        <asp:LinkButton ID="lbtnReturn" runat="server" CssClass="return_a" ClientIDMode="Static">返回</asp:LinkButton>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
                <td class="border_rbg IE6png">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="border_lconer IE6png" headers="17">
                    &nbsp;
                </td>
                <td colspan="2" class="border_bottomli IE6png" height="17">
                    &nbsp;
                </td>
                <td class="border_rconer IE6png" headers="17">
                    &nbsp;
                </td>
            </tr>
        </table>
    </div>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    </telerik:RadWindowManager>
    <asp:HiddenField ID="hidType" runat="server" />
    <asp:HiddenField ID="hidId" runat="server" />
    <asp:HiddenField ID="hidEmps" runat="server" />
    <asp:HiddenField ID="hidNote" runat="server" />
    <asp:HiddenField ID="hidNames" runat="server" />
    </form>
</body>
</html>
